\( \newcommand{\cO}{\mathcal{O}} \newcommand{\cC}{\mathcal{C}} \newcommand{\cP}{\mathcal{P}} \newcommand{\cF}{\mathcal{F}} \newcommand{\cS}{\mathcal{S}} \newcommand{\cK}{\mathcal{K}} \newcommand{\cM}{\mathcal{M}} \newcommand{\GG}{\mathbb{G}} \newcommand{\ZZ}{\mathbb{Z}} \newcommand{\NN}{\mathbb{N}} \newcommand{\PP}{\mathbb{P}} \newcommand{\QQ}{\mathbb{Q}} \newcommand{\RR}{\mathbb{R}} \newcommand{\LL}{\mathbb{L}} \newcommand{\HH}{\mathbb{H}} \newcommand{\EE}{\mathbb{E}} \newcommand{\SP}{\mathbb{S}} \newcommand{\CC}{\mathbb{C}} \newcommand{\FF}{\mathbb{F}} \renewcommand{\AA}{\mathbb{A}} \newcommand{\sF}{\mathscr{F}} \newcommand{\sC}{\mathscr{C}} \newcommand{\ts}{\textsuperscript} \newcommand{\mf}{\mathfrak} \newcommand{\cc}{\mf{c}} \newcommand{\mg}{\mf{g}} \newcommand{\ma}{\mf{a}} \newcommand{\mh}{\mf{h}} \newcommand{\mn}{\mf{n}} \newcommand{\mc}{\mf{c}} \newcommand{\ul}{\underline} \newcommand{\mz}{\mf{z}} \newcommand{\me}{\mf{e}} \newcommand{\mff}{\mf{f}} \newcommand{\mm}{\mf{m}} \newcommand{\mt}{\mf{t}} \newcommand{\pp}{\mf{p}} \newcommand{\qq}{\mf{q}} \newcommand{\gl}{\mf{gl}} \newcommand{\msl}{\mf{sl}} \newcommand{\so}{\mf{so}} \newcommand{\mfu}{\mf{u}} \newcommand{\su}{\mf{su}} \newcommand{\msp}{\mf{sp}} \renewcommand{\aa}{\mf{a}} \newcommand{\bb}{\mf{b}} \newcommand{\sR}{\mathscr{R}} \newcommand{\lb}{\langle} \newcommand{\rb}{\rangle} \newcommand{\ff}{\mf{f}} \newcommand{\ee}{\epsilon} \newcommand{\heart}{\heartsuit} \newcommand{\floor}[1]{\lfloor #1 \rfloor} \newcommand{\ceil}[1]{\lceil #1 \rceil} \newcommand{\pushout}{\arrow[ul, phantom, "\ulcorner", very near start]} \newcommand{\pullback}{\arrow[dr, phantom, "\lrcorner", very near start]} \newcommand{\simp}[1]{#1^{\Delta^{op}}} \newcommand{\arrowtcupp}[2]{\arrow[bend left=50, ""{name=U, below,inner sep=1}]{#1}\arrow[Rightarrow,from=U,to=MU,"#2"]} \newcommand{\arrowtclow}[2]{\arrow[bend right=50, ""{name=L,inner sep=1}]{#1}\arrow[Rightarrow,from=LM,to=L]{}[]{#2}} % if you want to change some parameter of the label. \newcommand{\arrowtcmid}[2]{\arrow[""{name=MU,inner sep=1},""{name=LM,below,inner sep=1}]{#1}[pos=.1]{#2}} \newcommand{\dummy}{\textcolor{white}{\bullet}} %for adjunction \newcommand{\adjunction}[4]{ #1\hspace{2pt}\colon #2 \leftrightharpoons #3 \hspace{2pt}\colon #4 } %Math operators \newcommand{\aug}{\mathop{\rm aug}\nolimits} \newcommand{\MC}{\mathop{\rm MC}\nolimits} \newcommand{\art}{\mathop{\rm art}\nolimits} \newcommand{\DiGrph}{\mathop{\rm DiGrph}\nolimits} \newcommand{\FMP}{\mathop{\rm FMP}\nolimits} \newcommand{\CAlg}{\mathop{\rm CAlg}\nolimits} \newcommand{\perf}{\mathop{\rm perf}\nolimits} \newcommand{\cof}{\mathop{\rm cof}\nolimits} \newcommand{\fib}{\mathop{\rm fib}\nolimits} \newcommand{\Thick}{\mathop{\rm Thick}\nolimits} \newcommand{\Orb}{\mathop{\rm Orb}\nolimits} \newcommand{\ko}{\mathop{\rm ko}\nolimits} \newcommand{\Spf}{\mathop{\rm Spf}\nolimits} \newcommand{\Spc}{\mathop{\rm Spc}\nolimits} \newcommand{\sk}{\mathop{\rm sk}\nolimits} \newcommand{\cosk}{\mathop{\rm cosk}\nolimits} \newcommand{\holim}{\mathop{\rm holim}\nolimits} \newcommand{\hocolim}{\mathop{\rm hocolim}\nolimits} \newcommand{\Pre}{\mathop{\rm Pre}\nolimits} \newcommand{\THR}{\mathop{\rm THR}\nolimits} \newcommand{\THH}{\mathop{\rm THH}\nolimits} \newcommand{\Fun}{\mathop{\rm Fun}\nolimits} \newcommand{\Loc}{\mathop{\rm Loc}\nolimits} \newcommand{\Bord}{\mathop{\rm Bord}\nolimits} \newcommand{\Cob}{\mathop{\rm Cob}\nolimits} \newcommand{\Set}{\mathop{\rm Set}\nolimits} \newcommand{\Ind}{\mathop{\rm Ind}\nolimits} \newcommand{\Sind}{\mathop{\rm Sind}\nolimits} \newcommand{\Ext}{\mathop{\rm Ext}\nolimits} \newcommand{\sd}{\mathop{\rm sd}\nolimits} \newcommand{\Ex}{\mathop{\rm Ex}\nolimits} \newcommand{\Out}{\mathop{\rm Out}\nolimits} \newcommand{\Cyl}{\mathop{\rm Cyl}\nolimits} \newcommand{\Path}{\mathop{\rm Path}\nolimits} \newcommand{\Ch}{\mathop{\rm Ch}\nolimits} \newcommand{\SSet}{\mathop{\rm \Set^{\Delta^{op}}}\nolimits} \newcommand{\Sq}{\mathop{\rm Sq}\nolimits} \newcommand{\Free}{\mathop{\rm Free}\nolimits} \newcommand{\Map}{\mathop{\rm Map}\nolimits} \newcommand{\Chain}{\mathop{\rm Ch}\nolimits} \newcommand{\LMap}{\mathop{\rm LMap}\nolimits} \newcommand{\RMap}{\mathop{\rm RMap}\nolimits} \newcommand{\Tot}{\mathop{\rm Tot}\nolimits} \newcommand{\MU}{\mathop{\rm MU}\nolimits} \newcommand{\MSU}{\mathop{\rm MSU}\nolimits} \newcommand{\MSp}{\mathop{\rm MSp}\nolimits} \newcommand{\MSO}{\mathop{\rm MSO}\nolimits} \newcommand{\MO}{\mathop{\rm MO}\nolimits} \newcommand{\BU}{\mathop{\rm BU}\nolimits} \newcommand{\BSU}{\mathop{\rm BSU}\nolimits} \newcommand{\BSp}{\mathop{\rm BSp}\nolimits} \newcommand{\BGL}{\mathop{\rm BGL}\nolimits} \newcommand{\BSO}{\mathop{\rm BSO}\nolimits} \newcommand{\BO}{\mathop{\rm BO}\nolimits} \newcommand{\Tor}{\mathop{\rm Tor}\nolimits} \newcommand{\Cotor}{\mathop{\rm Cotor}\nolimits} \newcommand{\imag}{\mathop{\rm Im}\nolimits} \newcommand{\real}{\mathop{\rm Re}\nolimits} \newcommand{\Cat}{\mathop{\rm Cat}\nolimits} \newcommand{\Fld}{\mathop{\rm Fld}\nolimits} \newcommand{\Frac}{\mathop{\rm Frac}\nolimits} \newcommand{\Dom}{\mathop{\rm Dom}\nolimits} \newcommand{\Hotc}{\mathop{\rm Hotc}\nolimits} \newcommand{\Top}{\mathop{\rm Top}\nolimits} \newcommand{\Ring}{\mathop{\rm Ring}\nolimits} \newcommand{\CRing}{\mathop{\rm CRing}\nolimits} \newcommand{\CGHaus}{\mathop{\rm CGHaus}\nolimits} \newcommand{\Alg}{\mathop{\rm Alg}\nolimits} \newcommand{\Bool}{\mathop{\rm Bool}\nolimits} \newcommand{\hTop}{\mathop{\rm hTop}\nolimits} \newcommand{\Nat}{\mathop{\rm Nat}\nolimits} \newcommand{\Rel}{\mathop{\rm Rel}\nolimits} \newcommand{\Mod}{\mathop{\rm Mod}\nolimits} \newcommand{\Space}{\mathop{\rm Space}\nolimits} \newcommand{\Vect}{\mathop{\rm Vect}\nolimits} \newcommand{\FinVect}{\mathop{\rm FinVect}\nolimits} \newcommand{\Matr}{\mathop{\rm Matr}\nolimits} \newcommand{\Ab}{\mathop{\rm Ab}\nolimits} \newcommand{\Gr}{\mathop{\rm Gr}\nolimits} \newcommand{\Grp}{\mathop{\rm Grp}\nolimits} \newcommand{\Hol}{\mathop{\rm Hol}\nolimits} \newcommand{\Gpd}{\mathop{\rm Gpd}\nolimits} \newcommand{\Grpd}{\mathop{\rm Gpd}\nolimits} \newcommand{\Mon}{\mathop{\rm Mon}\nolimits} \newcommand{\FinSet}{\mathop{\rm FinSet}\nolimits} \newcommand{\Sch}{\mathop{\rm Sch}\nolimits} \newcommand{\AffSch}{\mathop{\rm AffSch}\nolimits} \newcommand{\Idem}{\mathop{\rm Idem}\nolimits} \newcommand{\SIdem}{\mathop{\rm SIdem}\nolimits} \newcommand{\Aut}{\mathop{\rm Aut}\nolimits} \newcommand{\Ord}{\mathop{\rm Ord}\nolimits} \newcommand{\coker}{\mathop{\rm coker}\nolimits} \newcommand{\ch}{\mathop{\rm char}\nolimits}%characteristic \newcommand{\Sym}{\mathop{\rm Sym}\nolimits} \newcommand{\adj}{\mathop{\rm adj}\nolimits} \newcommand{\dil}{\mathop{\rm dil}\nolimits} \newcommand{\Cl}{\mathop{\rm Cl}\nolimits} \newcommand{\Diff}{\mathop{\rm Diff}\nolimits} \newcommand{\End}{\mathop{\rm End}\nolimits} \newcommand{\Hom}{\mathop{\rm Hom}\nolimits}% preferred \newcommand{\Gal}{\mathop{\rm Gal}\nolimits} \newcommand{\Pos}{\mathop{\rm Pos}\nolimits} \newcommand{\Ad}{\mathop{\rm Ad}\nolimits} \newcommand{\GL}{\mathop{\rm GL}\nolimits} \newcommand{\SL}{\mathop{\rm SL}\nolimits} \newcommand{\vol}{\mathop{\rm vol}\nolimits} \newcommand{\reg}{\mathop{\rm reg}\nolimits} \newcommand{\Or}{\text{O}} \newcommand{\U}{\mathop{\rm U}\nolimits} \newcommand{\SOr}{\mathop{\rm SO}\nolimits} \newcommand{\SU}{\mathop{\rm SU}\nolimits} \newcommand{\Spin}{\mathop{\rm Spin}\nolimits} \newcommand{\Sp}{\mathop{\rm Sp}\nolimits} \newcommand{\Int}{\mathop{\rm Int}\nolimits} \newcommand{\im}{\mathop{\rm im}\nolimits} \newcommand{\dom}{\mathop{\rm dom}\nolimits} \newcommand{\di}{\mathop{\rm div}\nolimits} \newcommand{\cod}{\mathop{\rm cod}\nolimits} \newcommand{\colim}{\mathop{\rm colim}\nolimits} \newcommand{\ad}{\mathop{\rm ad}\nolimits} \newcommand{\PSL}{\mathop{\rm PSL}\nolimits} \newcommand{\PGL}{\mathop{\rm PGL}\nolimits} \newcommand{\sep}{\mathop{\rm sep}\nolimits} \newcommand{\MCG}{\mathop{\rm MCG}\nolimits} \newcommand{\oMCG}{\mathop{\rm MCG^+}\nolimits} \newcommand{\Spec}{\mathop{\rm Spec}\nolimits} \newcommand{\rank}{\mathop{\rm rank}\nolimits} \newcommand{\diverg}{\mathop{\rm div}\nolimits}%Divergence \newcommand{\disc}{\mathop{\rm disc}\nolimits} \newcommand{\sign}{\mathop{\rm sign}\nolimits} \newcommand{\Arf}{\mathop{\rm Arf}\nolimits} \newcommand{\Pic}{\mathop{\rm Pic}\nolimits} \newcommand{\Tr}{\mathop{\rm Tr}\nolimits} \newcommand{\res}{\mathop{\rm res}\nolimits} \newcommand{\Proj}{\mathop{\rm Proj}\nolimits} \newcommand{\mult}{\mathop{\rm mult}\nolimits} \newcommand{\N}{\mathop{\rm N}\nolimits} \newcommand{\lk}{\mathop{\rm lk}\nolimits} \newcommand{\Pf}{\mathop{\rm Pf}\nolimits} \newcommand{\sgn}{\mathop{\rm sgn}\nolimits} \newcommand{\grad}{\mathop{\rm grad}\nolimits} \newcommand{\lcm}{\mathop{\rm lcm}\nolimits} \newcommand{\Ric}{\mathop{\rm Ric}\nolimits} \newcommand{\Hess}{\mathop{\rm Hess}\nolimits} \newcommand{\sn}{\mathop{\rm sn}\nolimits} \newcommand{\cut}{\mathop{\rm cut}\nolimits} \newcommand{\tr}{\mathop{\rm tr}\nolimits} \newcommand{\codim}{\mathop{\rm codim}\nolimits} \newcommand{\ind}{\mathop{\rm index}\nolimits} \newcommand{\rad}{\mathop{\rm rad}\nolimits} \newcommand{\Rep}{\mathop{\rm Rep}\nolimits} \newcommand{\Lie}{\mathop{\rm Lie}\nolimits} \newcommand{\Der}{\mathop{\rm Der}\nolimits} \newcommand{\hgt}{\mathop{\rm ht}\nolimits} \newcommand{\Ider}{\mathop{\rm Ider}\nolimits} \newcommand{\id}{\mathop{\rm id}\nolimits} \)

QUADRATIC FORMS

ISHAN LEVY

1. Introduction

When is a prime \(p\) of the form \(x^2+ny^2\)? More generally, when is it represented by the binary quadratic form \(ax^2+bxy+cy^2\) for \(a,b,c \in \ZZ \), meaning \(p=ax^2+bxy+cy^2\) has a solution? We can ask which numbers are represented by which quadratic forms and how many representations are there? We will be especially in the case that a number is of the form \(ax^2+bxy+cy^2\) with \(x,y\) relatively prime, in which case we will say it is properly represented by the form. We will explore Lagrange’s theory of reduced positive definite forms to get a better grasp on this problem.

We can view \(ax^2+bxy+cy^2\) as the product \(\begin{pmatrix}x & y\end{pmatrix} \begin{pmatrix}a & \frac b 2 \\ \frac b 2 & c\end{pmatrix} \begin{pmatrix}x \\ y\end{pmatrix}\) First note that we can replace \(x,y\) with linear functions in \(x\) and \(y\) and the result will still be a quadratic form. If this linear transformation is invertible, then we can say that the two quadratic forms are isomorphic. Isomorphic quadratic forms represent the same numbers. In the matrix form, if \(Q\) represents the quadratic form and \(A\) is the matrix representing the linear transformation, then the new matrix is represented by \(A^TQA\). Since \(\det (A^TQA)=\det Q\) as \(\det A= \pm 1\), \(4\det A = b^2-4ac\) is an isomorphism invariant of the quadratic form called its discriminant, denoted \(\disc (Q)\). Note that it is \(\equiv 0,1 \pmod 4\), and that \(b \equiv D \pmod 2\). More generally the discriminant changes by \(\det (A)^2\) if \(A\) has coefficients in \(\CC \). We will like to consider primitive quadratic forms, namely those where \((a,b,c)=(1)\). The problem of determining what the isomorphism classes of quadratic forms are and how many representations of a number a quadratic form has reduces easily to the case where it is primitive.

The discriminant greatly affects which primes are represented by the form \(Q\). We can complete the square to get \(4aQ = (2ax+by)^2 - \disc Qy^2\). This means that if \(\disc Q>0\), the form is definite, meaning that it takes on either nonnegative (positive definite) or nonpositive (negative definite) values depending on the sign of \(a\). If \(\disc Q<0\), it takes on both positive and negative values, so is indefinite. If \(\disc Q= 0\), it is degenerate, and the equation above makes it easy to determine what numbers are represented by the form. Here all of our forms will be primitive, and positive definite. Note that any discriminant \(\equiv 0,1 \pmod 4\) is attained by some quadratic form.

A slightly different equivalence relation that will be important is by requiring the matrix \(A\) to be in \(\SL _2(\ZZ )\). In this case we will say that \(Q\) is equivalent to \(A^TQA\).

It is easy to tell when two forms of the class are equivalent as we will soon see. Say that a form is reduced if \(|b|\leq a \leq c\) and if either of the inequalities are equalities, then we require \(b\) to be nonnegative as well.

Theorem 1.1. Every quadratic form is equivalent to a unique reduced quadratic form.

Proof. For existence of an equivalent reduced form, if \(|b|>a\), we can consider the map \(x,y \mapsto x,y-\sign (b)x\), which will make \(|b|\) smaller. If \(c\leq a\), we can swap \(a,c\) via \(x,y \mapsto y,-x\). Finally when \(|b|\leq a \leq c\), if \(-b = a\), it is easy to see that one of the previous transformations used will force \(b\) to be positive while preserving the inequalities.

Now to show that this is unique, we can first observe that for a reduced form, \(a\) can be recovered as being the smallest element represented by the form. Then, observe that we can recover whether \(a=c\) or not be looking at whether the value \(a\) is attained twice or more than twice by the quadratic form. If \(a = c\), then \(b\) can be recovered from the equation of the discriminant and the fact that it is nonnegative. If \(a<c\), then the value \(a\) is only obtained by \((x,y) = (1,0), (-1,0)\) so the only automorphisms of the quadratic form that fix the coefficient \(a\) are \(x,y \mapsto \pm x, \mp y+cx\). One only needs to check then that for any reduced form, applying any of these doesn’t yield a reduced form.

Exercise 1.1.1. The matrices \(\begin{pmatrix}1 & 1 \\ 0 & 1\end{pmatrix},\begin{pmatrix}0 & 1 \\ -1 & 0 \end{pmatrix}\) generate \(\SL _2(\ZZ )\).

Let’s find all equivalence class of quadratic forms of discriminants \(-12\). For a reduced form, \(a\leq \sqrt{12/3} = 2\). and \(b\) is an even number with \(b \leq a\). So either \((a,b) = (1,0),(2,0),(2,2)\). \(c = \frac{b^2-D}/4a\), giving the forms \(x^2+3y^2, 2x^2+\frac{3}{2}y^2, 2x^2+2xy+2y^2\). The only one that is primitive is \(x^2+3y^2\), so there is only one equivalence class.

Question 1.1.1. Is there a notion of reduced form for indefinite forms? Is it unique?

For \(D<0\) a discriminant, let \(\Cl (D)\) be the set of equivalence classes of quadratic forms of a particular discriminant. It is called the class group (though for now it is only a set).

Theorem 1.2. \(\Cl (D)\) is finite.

Proof. We only need to show there are finitely many reduced forms. For a reduced form, \(D = b^2-4ac\leq a^2-4a^2 =-3a^2\), so \(|b|\leq a \leq \sqrt{-\frac D 3}\), and \(c\) is determined by \(a,b\) via the formula for \(D\). Thus there are only finitely many possibilities.

We define \(h(D)\) to be the size of \(\Cl (D)\), and call it the class number of \(D\).

When is a number properly represented by a particular quadratic form? Here is a necessary and sufficient condition for this given a fixed discriminant.

Lemma 1.3. \(f\) is properly represented by a quadratic form iff the form is equivalent to a form \(fx^2+bxy+cy^2\)

Proof. Suppose \(f\) is properly represented by some quadratic form \(ax^2+bxy+cy^2\) for \(x = r, y = s\). Then there is a solution to \(rp-sq=1\), so consider the transformation \((x,y) \to (rx+qy,sx+py)\), and we will get an equivalent form with the \(x^2\) coefficient \(f\). Conversely, if the \(x^2\) coefficient is \(f\), then \(x=1,y=0\) will yield \(f\).

Theorem 1.4. \(f\) is properly represented by a quadratic form of discriminant \(D\) iff \(D\) is a square mod \(4f\).

Proof. By the previous theorem we can assume that the form is \(fx^2+bxy+cy^2\). Then \(D = b^2-4fc\) iff \(D \equiv b^2 \pmod{4f}\). Conversely, if we can solve \(D = b^2-4fc\), Then \(fx^2+bxy+cy^2\) is a form that works.

Exercise 1.4.1. \(-4\) is a square mod \(5\). Find a form \(5x^2+bxy+cy^2\) for some \(b,c \in \ZZ \) with discriminant \(-4\), and then show explicitly that it is equivalent to \(x^2+y^2\).

Now according to this calculation and the above theorem above, a prime \(p\) is represented by \(x^2+3y^2\) iff \(-12\) is a square mod \(4p\). If \(p\) is odd, This is equivalent to \(-3\) being a square mod \(p\), \((\frac{-3} p) = (\frac p 3)\) by quadratic reciprocity so we see that this holds iff \(p \equiv 1\pmod 3\).

Exercise 1.4.2. When is a prime of the form \(x^2+ny^2\) for \(n = 1,2,3,4,7\)? When is a prime of the form \(x^2+xy+ny^2\) for \(n = 1,2,3,5,7,11,17,41\)

Exercise 1.4.3. Construct reduced quadratic forms that are not \(x^2+ny^2\) of discriminant \(-4n\) to show that \(h(-4n)>1\) unless \(n=1,2,3,4,7\). How far does this technique work for discriminants \(-4n+1\)?

For \(D = -20\), There are two reduced forms, \(x^2+5y^2\) and \(2x^2+2xy+3y^2\). \(-20\) is a square mod \(4p\) iff it is a square mod \(p\) iff \(1 = (\frac{-20}{p}) = (\frac{-5}{p}) = (-1)^{\frac{p-1}{2}}(\frac p 5)\). This gives the condition \(p \equiv 1,3,7,9 \pmod{20}\). The relatively prime squares mod \(20\) are \(1,9 \pmod{20}\), so a of the form \(x^2+5y^2\) must be \(\equiv 1,9\) mod \(20\). Similarly, note that \(3(2x^2+2xy+3y^2) = 5x^2+(x+3y)^2\), so a prime of the form \(2x^2+2xy+3y^2\) is \(3,7 \pmod{20}\). So if \((\frac{-20}{4p})=1\), then \(p\) is represented by some quadratic form of discriminant \(-20\), but we can tell exactly which one it is by the congruence class of \(p\)! Thus we get the theorem:

Theorem 1.5. \(p\) is of the form \(x^2+5y^2\) iff \(p \equiv 1,9 \pmod{20}\), and of the form \(2x^2+2xy+3y^2\) iff \(p \equiv 3,7 \pmod{20}\).

So as long as all the reduced forms represent different different congruence classes for which \((\frac D{4p}) = 1\), then we can find out when a prime is represented by a particular form of discriminant \(D\).

We can divide the quadratic forms of a particular discriminant up based on which elements mod \(D\) they represent, and we call the set of quadratic forms representing a number a genus. So the techniques we have used show that if every genus contains only one quadratic form for a fixed discriminant, we can determine which primes are represented by any quadratic form of that discriminant.

Exercise 1.5.1. When is \(p\) of the form \(x^2+ny^2\) for \(n = 6,10,13,15,21,22,30\)?

When is \(2p\) is of the form \(x^2+5y^2\)?

Exercise 1.5.2. If \(2p\) is of the form \(x^2+5y^2\), then \(p \equiv 3,7 \pmod{20}\).

Is the converse true? Well we know that \(p\) is of the form \(2x^2+2xy+3y^2\), and the same holds for \(2\), so we can appeal to the identity that holds for any quadratic form of discriminant \(-4n\): \((ax^2+2bxy+cy^2)(az^2+2bzw+cw^2) = (axz+bxw+byz+cyw)^2+n(xw-yz)^2\). Thus we get:

Theorem 1.6. \(2p\) is of the form \(x^2+5y^2\) iff \(p \equiv 3,7 \pmod{20}\).

This identity is quite amazing! It shows that the congruence classes represented by \(x^2+5y^2\) are exactly the squares of those represented by \(2x^2+2xy+3y^2\). It turns out that given any two quadratic forms of equal discriminant, there is always an identity of the form above, where the forms are on the left hand side of the equation. Thus we can think of the form on the right hand side as a composite of the other two. Unfortunately, two forms may have many composites, but by being a little more careful, one can produce a well defined operation that actually turns the set \(\Cl (D)\) into an abelian group (hence the name class group)! This was first shown in Gauss’s Disquisitiones Arithmeticae, and is an amazing feat.

Finally I will remark that the quadratic forms \(x^2+14y^2\) and \(2x^2+7y^2\) represent the same numbers mod \(56\). And indeed, examples seem to show that about half of the primes in those congruence classes belong to each, and it is unclear which belong to which. Can we come up with a condition that tells us exactly which primes are represented by \(x^2+14y^2\) and which ones are not? This, and the more general problem of determining when a prime is represented by a quadratic form can be solved using the more modern tools of class field theory.